﻿<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <title>无标题文档</title>
    <script>
    function A() {
        this.abc = 12;
    }

    A.prototype.show = function() {
        alert(this.abc);
    };

    //继承A

    function B() {
        //this->new B()
        A.call(this);
    }

    B.prototype = A.prototype;

    var obj = new B();

    obj.show(); //12
    </script>
</head>

<body>
</body>

</html>